<%#
name: Host - Registered Content Hosts
snippet: false
template_inputs:
- name: Hosts filter
  required: false
  input_type: user
  description: Limit the report only on hosts found by this search query. Keep empty
    for report on all available hosts.
  advanced: false
  value_type: search
  resource_type: Host
model: ReportTemplate
require:
- plugin: katello
￼ version: 3.9.0
-%>
<%- report_headers 'Name', 'Ip', 'Operating System', 'Subscriptions', 'Applicable Errata', 'Owner', 'Kernel', 'Latest kernel available' -%>
<%- load_hosts(search: input('Hosts filter'), includes: [:operatingsystem, :subscriptions, :interfaces, :applicable_errata], preload: [:kernel_release, :owner]).each_record do |host| -%>
<%-   report_row(
        'Name': host.name,
        'Ip': host.ip,
        'Operating System': host.operatingsystem,
        'Subscriptions': host_subscriptions_names(host),
        'Applicable Errata': host_applicable_errata_ids(host),
        'Owner': host.owner,
        'Kernel': host_kernel_release(host),
        'Latest kernel available': host_latest_applicable_rpm_version(host, 'kernel')
      ) -%>
<%- end -%>
<%= report_render -%>
